import random
c = True
time = 0 
while True:
    a = random.randint(1,100)
    while c:
        b = int(input('请输入一个1-100以内的数字：'))
        if a > b :
            print("太小了！")
            time += 1
            continue
        elif a < b:
            print("太大了！")
            time += 1
            continue
        elif a == b :
            time += 1
            print("猜中了！！！,一共猜了{}轮".format(time))
            break
    d = input('是否还要继续(Y/N)?')
    if (d.lower()) == 'y':
        time = 0 
        continue
    else:
        print('退出！')
        break
            
            
            

